package cn.laixueit.service;

import cn.laixueit.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserService {

    @Autowired
    private UserDao userDao;


    public void save(){
        System.out.println("保存之前....");
        userDao.save();
        int i = 1/0;
        userDao.save();
        System.out.println("保存之后");
    }
}
